/* eslint-disable */
/* tslint:disable */
/*
 * ---------------------------------------------------------------
 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
 * ##                                                           ##
 * ## AUTHOR: acacode                                           ##
 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
 * ---------------------------------------------------------------
 */

import { createRequest } from "@/request/index";

import { baseUrl, LoginUserParams, User } from "./data-contracts";

export class UserClass {
  /**
   * No description
   *
   * @tags user
   * @name CreateUsersWithArrayInput
   * @summary Creates list of users with given input array
   * @request POST:/user/createWithArray
   * @response `default` `void` successful operation
   */
  static createUsersWithArrayInput = (body: User[], loading?: boolean) =>
    createRequest<void>({
      url: baseUrl + `/user/createWithArray`,
      method: "POST",
      loading,
      data: body,
    });
  /**
   * No description
   *
   * @tags user
   * @name CreateUsersWithListInput
   * @summary Creates list of users with given input array
   * @request POST:/user/createWithList
   * @response `default` `void` successful operation
   */
  static createUsersWithListInput = (body: User[], loading?: boolean) =>
    createRequest<void>({
      url: baseUrl + `/user/createWithList`,
      method: "POST",
      loading,
      data: body,
    });
  /**
   * No description
   *
   * @tags user
   * @name GetUserByName
   * @summary Get user by user name
   * @request GET:/user/{username}
   * @response `200` `User` successful operation
   * @response `400` `void` Invalid username supplied
   * @response `404` `void` User not found
   */
  static getUserByName = (username: string, loading?: boolean) =>
    createRequest<User>({
      url: baseUrl + `/user/${username}`,
      method: "GET",
      loading,
    });
  /**
   * @description This can only be done by the logged in user.
   *
   * @tags user
   * @name UpdateUser
   * @summary Updated user
   * @request PUT:/user/{username}
   * @response `400` `void` Invalid user supplied
   * @response `404` `void` User not found
   */
  static updateUser = (username: string, body: User, loading?: boolean) =>
    createRequest<any>({
      url: baseUrl + `/user/${username}`,
      method: "PUT",
      loading,
      data: body,
    });
  /**
   * @description This can only be done by the logged in user.
   *
   * @tags user
   * @name DeleteUser
   * @summary Delete user
   * @request DELETE:/user/{username}
   * @response `400` `void` Invalid username supplied
   * @response `404` `void` User not found
   */
  static deleteUser = (username: string, loading?: boolean) =>
    createRequest<any>({
      url: baseUrl + `/user/${username}`,
      method: "DELETE",
      loading,
    });
  /**
   * No description
   *
   * @tags user
   * @name LoginUser
   * @summary Logs user into the system
   * @request GET:/user/login
   * @response `200` `string` successful operation
   * @response `400` `void` Invalid username/password supplied
   */
  static loginUser = (query: LoginUserParams, loading?: boolean) =>
    createRequest<string>({
      url: baseUrl + `/user/login`,
      method: "GET",
      loading,
      query: query,
    });
  /**
   * No description
   *
   * @tags user
   * @name LogoutUser
   * @summary Logs out current logged in user session
   * @request GET:/user/logout
   * @response `default` `void` successful operation
   */
  static logoutUser = (loading?: boolean) =>
    createRequest<void>({
      url: baseUrl + `/user/logout`,
      method: "GET",
      loading,
    });
  /**
   * @description This can only be done by the logged in user.
   *
   * @tags user
   * @name CreateUser
   * @summary Create user
   * @request POST:/user
   * @response `default` `void` successful operation
   */
  static createUser = (body: User, loading?: boolean) =>
    createRequest<void>({
      url: baseUrl + `/user`,
      method: "POST",
      loading,
      data: body,
    });
}
